package com.wumz.netty.tomcat.bio.http;

import java.io.OutputStream;

/**
 * Created by wumz on 2021/2/4 15:44
 */
public class MyResponse {

    private OutputStream out;

    public MyResponse(OutputStream out) {
        this.out = out;
    }

    public void write(String s) throws Exception{
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("HTTP/1.1 200 OK\n")
                .append("Content-Type: text/html;\n")
                .append("\r\n")
                .append(s);
        out.write(stringBuilder.toString().getBytes());
    }
}
